<?php 

require_once('getconfig.php');

Class Model_maxtab extends Dbo_DbManager
 {

	protected $ctype;
	protected $nvalue;

 	public function __construct($bolCon=TRUE) {
		parent::__construct($bolCon);
	}
	
	public function getValue()
	{
		return  $this->nvalue;
	}

	public function setValue($nvalue)
	{
		$this->nvalue=$nvalue;
	}

	public function write()
	{
		$objDbManager = new Dbo_DbManager();
		return $objDbManager->write($this,FALSE);
	}
	public static function delete($intproductid)
	{
		$objDbManager = new Dbo_DbManager();
		return $objDbManager->remove($intproductid,__CLASS__);
	}

	public static function build(array $arrModel_maxtab)
	{
		$objModel_maxtab = new Model_maxtab(FALSE);
		@$objModel_maxtab->setValue($arrModel_maxtab['nvalue']);
		return $objModel_maxtab;
 	 } 	 
    
     public static function get_Maxtabvalue($type){
		$arrRes=array();
		$objDbManager = new Dbo_DbManager ();
		$qry="select * from maxtab where ctype='$type' ";
		$arrModel_User=$objDbManager->runquery("$qry");
		if (count( $arrModel_User ) > 0) {
			foreach ( $arrModel_User as $arrNew ) {
				$objUser = self::build ( $arrNew );
				$arrRes [] = $objUser;
			}
		}
		return $arrRes;
	}

 }
 ?>